<%@ page import="java.sql.*" %>

<% Class.forName("oracle.jdbc.OracleDriver"); %>
<html>
<head>
<title> MBLT Inventory </title>

<style>
#picture{
    float:left;
    width: 300px;
	}
	</style>
</head>

<body  background="bg3.jpg">

 <% 
            Connection connection = DriverManager.getConnection(
                "jdbc:oracle:thin:@localhost:1521:xe", "SEPROJECT", "123456");

            Statement statement = connection.createStatement() ;
            ResultSet resultset = statement.executeQuery("select * from PRODUCT") ; 
        %>


<h2 align = "center"><a href="home4.jsp" style="text-decoration:blink;"><b>Home</b></a>&nbsp;&nbsp;&nbsp;<a href="add4.jsp" style="text-decoration:blink;"><b>Add a product</b></a>&nbsp;&nbsp;&nbsp;<a href="hello.jsp" style="text-decoration:blink;"><b>Inventory</b></a>&nbsp;&nbsp;&nbsp;<a href="search4.jsp" style="text-decoration:blink;">search</a>&nbsp;&nbsp;&nbsp;<a href="abtus.jsp" style="text-decoration:blink;"><b>About Us</b></a></h2>
<h3 align ="right"><a href="login.jsp" style="text-decoration:blink;"><b>Logout</b></a></h3>
<br>
<br>
<br>
<hr>

<br>
<div id ="picture">
<img src="can-stock-photo_csp11751485.jpg" alt="" width = 320 height=200 align="center">
</div>


<BR>
<BR>

<center>
<div>
 
            <% while(resultset.next()){ 
	
	int s_qty = resultset.getInt("STOCK_QTY");	
	int r_qty = resultset.getInt("REORDER_QTY");	

	if(s_qty<r_qty) {

%>
	
	<p> Warning : The below product(s) are about to exhaust. </p>

<TABLE BORDER="1">
            <TR>
                <TH>ID</TH>
                <TH>Category</TH>
                <TH>Name</TH>
                <TH>Description</TH>
                <TH>Stock Qty</TH>
	 <TH>Reorder Qty</TH>
            </TR>

            <TR>
                <TD> <%= resultset.getString(1) %></TD>
                <TD> <%= resultset.getString(2) %></TD>
                <TD> <%= resultset.getString(3) %></TD>
	<TD> <%= resultset.getString(4) %></TD>
	<TD> <%= resultset.getString(5) %></TD>
	<TD> <%= resultset.getString(6) %></TD>
               
            </TR>

	 <%} } %>

	<br><br><br><br><br>
        </TABLE>
</div>
</center>

</a>
<hr>
<br>
<br><br>



<center>
MAKE AN APPOINTMENT <br>
COME TO VISIT <br>
500 Terry Francois Street San Francisco, CA 94158 <br>
info@mysite.com <br>
Tel: 123-456-7890 <br>
Fax: 123-456-7890 <br>
</center>

<br>
<br>
<br>


</body>

</html>